package com.xd.cloud.common.sql;

import java.sql.ResultSet;
import java.sql.SQLException;

public class Demo {

	static String sql = null;  
    static DBHelper db1 = null;  
    static ResultSet ret = null;  

    public static void main(String[] args) {  
    	
//    	TrackReplayData rp = new TrackReplayData();
//    	rp.queryTrackReplayData("64939160396", "2017-12-19", "2017-12-23");
    	
    	for (int i=0;i<1;i++)
    	{
    		long  a = System.currentTimeMillis();
//        sql = "select * from tb_msg where create_time > '2017-02-20'";//SQL语句  
//	        sql = "insert into tb_msg(id,name,create_time) values(next value for MYCATSEQ_GLOBAL,'2','2017-02-18')";
	        
//	        sql = "insert into tb_gps_data(device_id,lat,lng,speed,direction,acc,power,location,mileage,systemtime,gpstime,status,voltage,csq,sim_card,create_time) values('64939160396',31.249166,120.6106,17,270,'1','0','江苏省苏州市',234.56,NOW(),NOW(),'ACC开,定位,油路正常,电路正常,车门解锁,','','','1064939160396','2017-12-20 9:17:54')";
	        
//	        sql = "INSERT INTO tb_gps_data(device_id,lat,lng,speed,direction,acc,power,mileage,ol,status,voltage,csq,gpstime,create_time) VALUES ('64939160396', '31.249166', '120.610600', '17', '270', '1', '0', '234.56', '123', 'ACC开,定位,油路正常,电路正常,车门解锁,', '0', '0', '2017-12-22 13:16:11', '2017-11-12')";
	        
	        
//	        sql = "INSERT INTO jt808_gps_data (id,device_id, lat, lng, speed, direction, acc, mileage, ol, status, csq,gpstime, create_time) VALUES ('db395c9f-1b59-45d8-909f-fe7a3851f19b', '64939003648', 31.26965, 120.7342, 0, 0, 1, 353.7, 0, '', 31, '2017/12/28 7:00:22', '2017-12-28 07:00:25')";
	        
    		sql = "INSERT INTO jt808_gps_data (id,device_id, lat, lng, speed, direction, acc, mileage, ol, status, csq,gpstime, create_time) VALUES ('d2e61509-9886-421c-9f83-513bec2a128a', '64939003648', 31.2597, 120.7345, 0, 0, 1, 362.1, 0, 'ACC开;车辆油路正常;车辆电路正常;车门解锁;', 31, '2017-12-28 17:28:23', '2017-12-28 17:28:24')";
    		
//    		sql = "INSERT INTO jt808_alarm_data (id, key1, key2, key3, key4, key5, key6, key7, key8, key9, key10, key11, key12, key13, key14, key15, key16, key17, key18, key19, key20, key21, key22, key23, key24, key25, key26, key27, key28, key29, key30, key31, key32, create_time) VALUES('db595c9f-1b59-45d8-909f-fe7a3851f19b',1,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'2017-12-28 07:00:25')";	        
    		
//    		sql = "INSERT INTO jt808_alarm_status_data (id, key1, key2, key3, key4, key5, key6, key7, key8, key9, key10, key11, key12, key13, key14, key15, key16, key17, key18, key19, key20, key21, key22, key23, key24, key25, key26, key27, key28, key29, key30, key31, key32, create_time) VALUES('db395c9f-1b59-45d8-909f-fe7a3851f19b',1,1,0,0, 0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,'2017-12-28 07:00:25')";
    		
//    		sql = "insert into tb_message(device_id,msgtype,msgcontent,status,create_time) values('64939003648',0,'今天天气下雨',0,'2017-02-18')";
    		
	        db1 = new DBHelper(sql);//创建DBHelper对象  
	
	        try {  
	        	db1.pst.execute();
	  
//	            ret = db1.pst.executeQuery();//执行语句，得到结果集  
//	            while (ret.next()) {  
//	                System.out.println(ret.getString(1)+"    ,    "+ret.getString(2)+"    ,    "+ret.getString(3));
//	            }//显示数据  
//	            ret.close();  
	            db1.close();//关闭连接  
	          	long b = System.currentTimeMillis();
	        	System.out.println(b-a);
	        } catch (SQLException e) {  
	            e.printStackTrace();  
	        }  
    	}
    }  

}
